<?php

class Core_Model_DbTable_Plugins extends Nuo_Db_Table
{

	/**
	 * module table name
	 * @property string
	 */
	protected $_name = 'core_plugins';

	/**
	 * Module model class
	 * @property string
	 */
	protected $_rowClass = 'Core_Model_Plugin';

	/**
	 * fetch to array of object
	 * @return array
	 */
	public function getAsOptions()
	{
		$select = $this -> select() -> where('type=?', 'module')->order('priority');

		$result = array();
		
		foreach ($this->fetchAll($select) as $row)
		{
			$result[$row -> getId()] = $row -> getTitle();
		}
		
		return $result;
	}

}
